<template>
  <div>
    <bread second="权限管理" third="权限列表"></bread>
    <el-card class="box-card" style="margin-top:15px">
      <el-table :data="tableData" border style="width: 100%">
        <el-table-column type="index" label="#"></el-table-column>
        <el-table-column prop="authName" label="权限名称"></el-table-column>
        <el-table-column prop="path" label="路径"></el-table-column>
        <el-table-column prop label="权限等级">
          <template slot-scope="scoped">
            <el-tag v-if="scoped.row.level==0">一级</el-tag>
            <el-tag v-else-if="scoped.row.level==1" type="success">二级</el-tag>
            <el-tag v-else type="warning">三级</el-tag>
          </template>
        </el-table-column>
      </el-table>
    </el-card>
  </div>
</template>
<script>
/* eslint-disable */
import { getRightList_api } from '@/api/index.js'
export default {
  data() {
    return {
      tableData: null,
    }
  },
  created() {
    this.getRightList()
  },
  methods: {
    // 获取权限列表
    async getRightList() {
      const { data: res } = await getRightList_api('list')
      console.log(res);
      this.tableData = res.data
      if (res.data.meta == 200) {
        this.$message({
          message: res.meta.msg,
          type: 'success'
        })


      }
    }
  }
}
</script>
<style lang="less" scoped>
.box-card {
  width: 100%;
}
</style>
